package com.kunchi.wms.stock.api;

import com.kunchi.isb.base.exception.ISBException;
import com.kunchi.isb.base.result.ISBResult;
import com.kunchi.isb.service.ISBJsonParamService;
import com.kunchi.wms.stock.po.Stock;
import com.kunchi.wms.stock.service.StockService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "库存", tags = {"stockFindAll"},description = "查询全部库存信息")
@RestController
@RequestMapping("/wms/stockFindAll")
public class StockFindAllApi extends ISBJsonParamService<Stock,List<Stock>> {
    @Autowired
    StockService stockService;

    @Override
    protected ISBResult doService(ISBResult<List<Stock>> isbResult, Stock stock) throws ISBException {
        List<Stock> stocks = stockService.findAll();
        isbResult.setBody(stocks);
        return isbResult;
    }
}
